inherited frmPurchaseBill: TfrmPurchaseBill
  Left = 477
  Top = 156
  Caption = #37319#36141#24320#21333
  PixelsPerInch = 96
  TextHeight = 12
  inherited pnlDBCtrl: TPanel
    inherited pnlThirdtrade: TPanel
      TabOrder = 7
      inherited lblTTtraderid: TcxLabel
        AnchorX = 78
      end
      inherited cxLabel1: TcxLabel
        Left = 216
        ExplicitLeft = 216
        AnchorX = 244
      end
      inherited lblTTBalanceid: TcxLabel
        Left = 381
        ExplicitLeft = 381
        AnchorX = 433
      end
    end
    inherited lblName: TcxLabel
      Left = 20
      ExplicitLeft = 20
    end
    inherited edtDate: TcxDBDateEdit
      ExplicitHeight = 20
    end
    inherited edtCode: TcxDBTextEdit
      ExplicitHeight = 20
    end
    inherited DtlPageCtrl: TcxPageControl
      TabOrder = 10
      inherited tabMain: TcxTabSheet
        inherited DtlGrid: TcxGrid
          inherited DtlGridDBTableView: TcxGridDBBandedTableView
            object colDepotid: TcxGridDBBandedColumn
              DataBinding.FieldName = 'depotid'
              Visible = False
              Position.BandIndex = 0
              Position.ColIndex = 8
              Position.RowIndex = 0
            end
          end
        end
      end
    end
    object lblInvoice: TcxLabel [7]
      Left = 244
      Top = 10
      Caption = #24320#31080
      ParentFont = False
      Style.Font.Charset = GB2312_CHARSET
      Style.Font.Color = clBlue
      Style.Font.Height = -16
      Style.Font.Name = #23435#20307
      Style.Font.Style = [fsBold]
      Style.TextColor = clRed
      Style.IsFontAssigned = True
      Transparent = True
    end
    object lblBalance: TcxLabel [8]
      Left = 321
      Top = 9
      Caption = #24050#32467#31639
      ParentFont = False
      Style.Font.Charset = GB2312_CHARSET
      Style.Font.Color = clBlue
      Style.Font.Height = -16
      Style.Font.Name = #23435#20307
      Style.Font.Style = [fsBold]
      Style.TextColor = clRed
      Style.IsFontAssigned = True
      Transparent = True
      Visible = False
    end
    inherited edtCreate_time: TcxDBTimeEdit
      ExplicitHeight = 20
    end
    inherited imgAbate: TcxImage
      Left = 227
      ExplicitLeft = 227
    end
    inherited dynlblCreate_by: TcxLabel
      AnchorX = 221
    end
    inherited dynedtCreate_by: TcxDBLookupComboBox
      ExplicitHeight = 20
    end
    inherited dynlblCheck_by: TcxLabel
      AnchorX = 429
    end
    inherited dynedtCheck_by: TcxDBLookupComboBox
      ExplicitHeight = 20
    end
    inherited dynlblFilid: TcxLabel
      AnchorX = 88
    end
    inherited dynedtFilid: TcxDBLookupComboBox
      ExplicitHeight = 20
    end
    inherited dynlblDeptid: TcxLabel
      AnchorX = 301
    end
    inherited dynedtDeptid: TcxDBLookupComboBox
      ExplicitHeight = 20
    end
    inherited dynlblEmpid: TcxLabel
      AnchorX = 505
    end
    inherited dynedtEmpid: TcxDBLookupComboBox
      ExplicitHeight = 20
    end
    inherited dynlblBKind: TcxLabel
      AnchorX = 149
    end
    inherited dynedtBKind: TcxDBLookupComboBox
      ExplicitHeight = 20
    end
    object dynlblTraderid: TcxLabel
      Left = 314
      Top = 68
      AutoSize = False
      Caption = #20379#24212#21830
      Properties.Alignment.Horz = taRightJustify
      Visible = False
      Height = 16
      Width = 43
      AnchorX = 357
    end
    object dynedtT_name: TcxDBLookupComboBox
      Left = 356
      Top = 64
      Properties.ListColumns = <>
      TabOrder = 26
      Visible = False
      Width = 145
    end
  end
  inherited pnlTop: TPanel
    inherited edtPrint: TcxLookupComboBox
      ExplicitHeight = 20
    end
  end
  inherited pnlBottom: TPanel
    inherited barBill: TcxProgressBar
      ExplicitHeight = 20
    end
  end
  inherited MainDataSource: TDataSource
    Left = 221
  end
  inherited MainMenu1: TMainMenu
    Left = 10
  end
  inherited PopupMenu1: TPopupMenu
    Left = 356
  end
  inherited pmExec: TPopupMenu
    Left = 408
    Top = 85
    object muInvoice: TMenuItem [4]
      Caption = #24320#31080
      OnClick = muInvoiceClick
    end
  end
  inherited pmRelation: TPopupMenu
    Left = 460
    Top = 77
  end
  inherited dsDetail: TDataSource
    Left = 340
    Top = 309
  end
  inherited pmDetail: TPopupMenu
    Left = 540
    Top = 91
  end
  inherited cxStyleRepository1: TcxStyleRepository
    PixelsPerInch = 96
    inherited cxGridBandedTableViewStyleSheet1: TcxGridBandedTableViewStyleSheet
      BuiltIn = True
    end
  end
  inherited cdsMaster: TClientDataSet
    object cdsMasterbid: TIntegerField
      FieldName = 'bid'
    end
    object cdsMasterbkind: TIntegerField
      FieldName = 'bkind'
    end
    object cdsMasterbstate: TIntegerField
      FieldName = 'bstate'
    end
    object cdsMasterbcode: TStringField
      FieldName = 'bcode'
      Size = 40
    end
    object cdsMasterbdate: TDateTimeField
      FieldName = 'bdate'
    end
    object cdsMastertraderid: TIntegerField
      FieldName = 'traderid'
    end
    object cdsMasternotetype: TIntegerField
      FieldName = 'notetype'
    end
    object cdsMasternoteno: TStringField
      FieldName = 'noteno'
      Size = 40
    end
    object cdsMasterbalanceid: TIntegerField
      FieldName = 'balanceid'
    end
    object cdsMasteraccountid: TIntegerField
      FieldName = 'accountid'
    end
    object cdsMasterfilid: TIntegerField
      FieldName = 'filid'
    end
    object cdsMasterempid: TIntegerField
      FieldName = 'empid'
    end
    object cdsMastercreate_by: TIntegerField
      FieldName = 'create_by'
    end
    object cdsMastercheck_by: TIntegerField
      FieldName = 'check_by'
    end
    object cdsMasterdeptid: TIntegerField
      FieldName = 'deptid'
    end
    object cdsMastervoucherid: TIntegerField
      FieldName = 'voucherid'
    end
    object cdsMastercostvoucherid: TIntegerField
      FieldName = 'costvoucherid'
    end
    object cdsMastertransporttype: TIntegerField
      FieldName = 'transporttype'
    end
    object cdsMastercheckno: TStringField
      FieldName = 'checkno'
      Size = 40
    end
    object cdsMastertargetaddr: TStringField
      FieldName = 'targetaddr'
      Size = 200
    end
    object cdsMastertermdays: TIntegerField
      FieldName = 'termdays'
    end
    object cdsMasterdisc: TFloatField
      FieldName = 'disc'
    end
    object cdsMastertaxrate: TFloatField
      FieldName = 'taxrate'
    end
    object cdsMasteramount: TFloatField
      FieldName = 'amount'
    end
    object cdsMasterbalanceamt: TFloatField
      FieldName = 'balanceamt'
    end
    object cdsMasterrelationamt: TFloatField
      FieldName = 'relationamt'
    end
    object cdsMasterrelationcount: TByteField
      FieldName = 'relationcount'
    end
    object cdsMastersaleorderbcode: TStringField
      FieldName = 'saleorderbcode'
      Size = 200
    end
    object cdsMasterbtraderid: TIntegerField
      FieldName = 'btraderid'
    end
    object cdsMasterinvbdate: TDateTimeField
      FieldName = 'invbdate'
    end
    object cdsMasterinvtype: TIntegerField
      FieldName = 'invtype'
    end
    object cdsMasterinvamt: TFloatField
      FieldName = 'invamt'
    end
    object cdsMasterinvclose: TIntegerField
      FieldName = 'invclose'
    end
    object cdsMastercustom1: TStringField
      FieldName = 'custom1'
      Size = 200
    end
    object cdsMastercustom2: TStringField
      FieldName = 'custom2'
      Size = 200
    end
    object cdsMastercustom3: TStringField
      FieldName = 'custom3'
      Size = 200
    end
    object cdsMastercustom4: TStringField
      FieldName = 'custom4'
      Size = 200
    end
    object cdsMastercustom5: TStringField
      FieldName = 'custom5'
      Size = 200
    end
    object cdsMastercustom6: TStringField
      FieldName = 'custom6'
      Size = 200
    end
    object cdsMastercustom7: TStringField
      FieldName = 'custom7'
      Size = 200
    end
    object cdsMastercustom8: TStringField
      FieldName = 'custom8'
      Size = 200
    end
    object cdsMastercustom9: TStringField
      FieldName = 'custom9'
      Size = 200
    end
    object cdsMastercustom10: TStringField
      FieldName = 'custom10'
      Size = 200
    end
    object cdsMasterupdate_time: TDateTimeField
      FieldName = 'update_time'
    end
    object cdsMasterremark: TStringField
      FieldName = 'remark'
      Size = 200
    end
    object cdsMasterbalancedate: TDateTimeField
      FieldName = 'balancedate'
    end
    object cdsMastercontacter: TStringField
      FieldName = 'contacter'
      Size = 60
    end
    object cdsMastercontactphone: TStringField
      FieldName = 'contactphone'
      Size = 40
    end
    object cdsMastercontactfax: TStringField
      FieldName = 'contactfax'
      Size = 60
    end
    object cdsMastercreate_time: TDateTimeField
      FieldName = 'create_time'
    end
    object cdsMastercheck_time: TDateTimeField
      FieldName = 'check_time'
    end
    object cdsMastercustom11: TFloatField
      FieldName = 'custom11'
    end
    object cdsMastercustom12: TFloatField
      FieldName = 'custom12'
    end
    object cdsMastercustom13: TFloatField
      FieldName = 'custom13'
    end
    object cdsMastercustom14: TFloatField
      FieldName = 'custom14'
    end
    object cdsMastercustom15: TFloatField
      FieldName = 'custom15'
    end
    object cdsMastermoneyid: TIntegerField
      FieldName = 'moneyid'
    end
    object cdsMasterexchrate: TFloatField
      FieldName = 'exchrate'
    end
    object cdsMasterdcamount: TFloatField
      FieldName = 'dcamount'
    end
    object cdsMasterdcbalanceamt: TFloatField
      FieldName = 'dcbalanceamt'
    end
    object cdsMasterdcrelationamt: TFloatField
      FieldName = 'dcrelationamt'
    end
    object cdsMasterrelationsuramt: TFloatField
      FieldName = 'relationsuramt'
    end
    object cdsMasterdcrelationsuramt: TFloatField
      FieldName = 'dcrelationsuramt'
    end
    object cdsMasterdepotid: TIntegerField
      FieldName = 'depotid'
    end
    object cdsMasterscamt: TFloatField
      FieldName = 'scamt'
    end
    object cdsMasteriscash: TBooleanField
      FieldName = 'iscash'
    end
    object cdsMastert_code: TWideStringField
      FieldName = 't_code'
      Size = 50
    end
    object cdsMastert_name: TWideStringField
      FieldName = 't_name'
      Size = 80
    end
    object cdsMasterbt_code: TWideStringField
      FieldName = 'bt_code'
      Size = 50
    end
    object cdsMasterbt_name: TWideStringField
      FieldName = 'bt_name'
      Size = 80
    end
    object cdsMasternotetypename: TStringField
      FieldName = 'notetypename'
      Size = 50
    end
    object cdsMastermoneycode: TStringField
      FieldName = 'moneycode'
      Size = 40
    end
    object cdsMastermoneyname: TStringField
      FieldName = 'moneyname'
      Size = 60
    end
    object cdsMastervouchercode: TStringField
      FieldName = 'vouchercode'
      Size = 71
    end
    object cdsMasterprojectid: TIntegerField
      FieldName = 'projectid'
    end
    object cdsMasterpjcode: TWideStringField
      FieldName = 'pjcode'
      Size = 40
    end
    object cdsMasterpjname: TWideStringField
      FieldName = 'pjname'
      Size = 60
    end
  end
  inherited dspMaster: TDataSetProvider
    Top = 193
  end
  inherited dspDetail: TDataSetProvider
    Left = 232
    Top = 309
  end
  inherited cdsDetail: TClientDataSet
    Left = 284
    Top = 305
    object cdsDetailbid: TIntegerField
      FieldName = 'bid'
    end
    object cdsDetailbno: TIntegerField
      FieldName = 'bno'
    end
    object cdsDetailborderno: TIntegerField
      FieldName = 'borderno'
    end
    object cdsDetaildepotid: TIntegerField
      FieldName = 'depotid'
    end
    object cdsDetailproductid: TIntegerField
      FieldName = 'productid'
    end
    object cdsDetailcprice: TFloatField
      FieldName = 'cprice'
    end
    object cdsDetailbprice: TFloatField
      FieldName = 'bprice'
    end
    object cdsDetailbquantity: TFloatField
      FieldName = 'bquantity'
    end
    object cdsDetaildisc: TFloatField
      FieldName = 'disc'
    end
    object cdsDetailtaxrate: TFloatField
      FieldName = 'taxrate'
    end
    object cdsDetailamount: TFloatField
      FieldName = 'amount'
    end
    object cdsDetailunitid: TIntegerField
      FieldName = 'unitid'
    end
    object cdsDetailquantity: TFloatField
      FieldName = 'quantity'
    end
    object cdsDetailprice: TFloatField
      FieldName = 'price'
    end
    object cdsDetailunit1qty: TFloatField
      FieldName = 'unit1qty'
    end
    object cdsDetailunit2qty: TFloatField
      FieldName = 'unit2qty'
    end
    object cdsDetailunit3qty: TFloatField
      FieldName = 'unit3qty'
    end
    object cdsDetailassqty: TFloatField
      FieldName = 'assqty'
    end
    object cdsDetailrelationassqty: TFloatField
      FieldName = 'relationassqty'
    end
    object cdsDetailtaxamt: TFloatField
      FieldName = 'taxamt'
    end
    object cdsDetailproductamt: TFloatField
      FieldName = 'productamt'
    end
    object cdsDetailbatchcode: TStringField
      FieldName = 'batchcode'
      Size = 200
    end
    object cdsDetailproductdate: TDateTimeField
      FieldName = 'productdate'
    end
    object cdsDetailvaliddate: TDateTimeField
      FieldName = 'validdate'
    end
    object cdsDetailrelationpid: TIntegerField
      FieldName = 'relationpid'
    end
    object cdsDetailrelationcount: TByteField
      FieldName = 'relationcount'
    end
    object cdsDetailrelationbtype: TIntegerField
      FieldName = 'relationbtype'
    end
    object cdsDetailrelationbid: TIntegerField
      FieldName = 'relationbid'
    end
    object cdsDetailrelationbno: TIntegerField
      FieldName = 'relationbno'
    end
    object cdsDetailrelationqty: TFloatField
      FieldName = 'relationqty'
    end
    object cdsDetailsaleorderbcode: TStringField
      FieldName = 'saleorderbcode'
      Size = 60
    end
    object cdsDetailioqty: TFloatField
      FieldName = 'ioqty'
    end
    object cdsDetailinvqty: TFloatField
      FieldName = 'invqty'
    end
    object cdsDetailinvamt: TFloatField
      FieldName = 'invamt'
    end
    object cdsDetailcustom1: TStringField
      FieldName = 'custom1'
      Size = 200
    end
    object cdsDetailcustom2: TStringField
      FieldName = 'custom2'
      Size = 200
    end
    object cdsDetailcustom3: TStringField
      FieldName = 'custom3'
      Size = 200
    end
    object cdsDetailcustom4: TStringField
      FieldName = 'custom4'
      Size = 200
    end
    object cdsDetailcustom5: TStringField
      FieldName = 'custom5'
      Size = 200
    end
    object cdsDetailcustom6: TStringField
      FieldName = 'custom6'
      Size = 200
    end
    object cdsDetailcustom7: TStringField
      FieldName = 'custom7'
      Size = 200
    end
    object cdsDetailcustom8: TStringField
      FieldName = 'custom8'
      Size = 200
    end
    object cdsDetailcustom9: TStringField
      FieldName = 'custom9'
      Size = 200
    end
    object cdsDetailcustom10: TStringField
      FieldName = 'custom10'
      Size = 200
    end
    object cdsDetailexplan: TStringField
      FieldName = 'explan'
      Size = 200
    end
    object cdsDetailsplitbtype: TIntegerField
      FieldName = 'splitbtype'
    end
    object cdsDetailsplitbid: TIntegerField
      FieldName = 'splitbid'
    end
    object cdsDetailsplitbno: TIntegerField
      FieldName = 'splitbno'
    end
    object cdsDetailalreadyapt: TFloatField
      FieldName = 'alreadyapt'
    end
    object cdsDetailcontractno: TStringField
      FieldName = 'contractno'
      Size = 40
    end
    object cdsDetailtaxprice: TFloatField
      FieldName = 'taxprice'
    end
    object cdsDetailformerprice: TFloatField
      FieldName = 'formerprice'
    end
    object cdsDetailformertaxprice: TFloatField
      FieldName = 'formertaxprice'
    end
    object cdsDetailpresent: TBooleanField
      FieldName = 'present'
    end
    object cdsDetailcreate_time: TDateTimeField
      FieldName = 'create_time'
    end
    object cdsDetailcustom11: TFloatField
      FieldName = 'custom11'
    end
    object cdsDetailcustom12: TFloatField
      FieldName = 'custom12'
    end
    object cdsDetailcustom13: TFloatField
      FieldName = 'custom13'
    end
    object cdsDetailcustom14: TFloatField
      FieldName = 'custom14'
    end
    object cdsDetailcustom15: TFloatField
      FieldName = 'custom15'
    end
    object cdsDetaildcbprice: TFloatField
      FieldName = 'dcbprice'
    end
    object cdsDetaildcprice: TFloatField
      FieldName = 'dcprice'
    end
    object cdsDetaildcproductamt: TFloatField
      FieldName = 'dcproductamt'
    end
    object cdsDetaildcamount: TFloatField
      FieldName = 'dcamount'
    end
    object cdsDetaildctaxprice: TFloatField
      FieldName = 'dctaxprice'
    end
    object cdsDetaildctaxamt: TFloatField
      FieldName = 'dctaxamt'
    end
    object cdsDetaillength: TFloatField
      FieldName = 'length'
    end
    object cdsDetailwidth: TFloatField
      FieldName = 'width'
    end
    object cdsDetailheight: TFloatField
      FieldName = 'height'
    end
    object cdsDetailspecificweight: TFloatField
      FieldName = 'specificweight'
    end
    object cdsDetailcustom16: TFloatField
      FieldName = 'custom16'
    end
    object cdsDetailcustom17: TFloatField
      FieldName = 'custom17'
    end
    object cdsDetailcustom18: TFloatField
      FieldName = 'custom18'
    end
    object cdsDetailcustom19: TFloatField
      FieldName = 'custom19'
    end
    object cdsDetailcustom20: TFloatField
      FieldName = 'custom20'
    end
    object cdsDetailweightfranchise: TFloatField
      FieldName = 'weightfranchise'
    end
    object cdsDetailwfqty: TFloatField
      FieldName = 'wfqty'
    end
    object cdsDetailAllqty: TStringField
      FieldName = 'Allqty'
      Size = 30
    end
    object cdsDetailrelationbcode: TStringField
      FieldName = 'relationbcode'
      Size = 30
    end
    object cdsDetaildiscamt: TFloatField
      FieldName = 'discamt'
    end
    object cdsDetailp_code: TStringField
      FieldName = 'p_code'
      Size = 40
    end
    object cdsDetailp_name: TWideStringField
      FieldName = 'p_name'
      Size = 60
    end
    object cdsDetailp_spec: TWideStringField
      FieldName = 'p_spec'
      Size = 60
    end
    object cdsDetailp_kind: TIntegerField
      FieldName = 'p_kind'
    end
    object cdsDetailp_calc: TByteField
      FieldName = 'p_calc'
    end
    object cdsDetailp_batch: TBooleanField
      FieldName = 'p_batch'
    end
    object cdsDetailp_abname: TWideStringField
      FieldName = 'p_abname'
      Size = 60
    end
    object cdsDetailp_custom1: TStringField
      FieldName = 'p_custom1'
      Size = 100
    end
    object cdsDetailp_custom2: TStringField
      FieldName = 'p_custom2'
      Size = 100
    end
    object cdsDetailp_custom3: TStringField
      FieldName = 'p_custom3'
      Size = 100
    end
    object cdsDetailp_custom4: TStringField
      FieldName = 'p_custom4'
      Size = 100
    end
    object cdsDetailp_custom5: TStringField
      FieldName = 'p_custom5'
      Size = 100
    end
    object cdsDetailp_custom6: TStringField
      FieldName = 'p_custom6'
      Size = 100
    end
    object cdsDetailp_custom7: TStringField
      FieldName = 'p_custom7'
      Size = 100
    end
    object cdsDetailp_custom8: TStringField
      FieldName = 'p_custom8'
      Size = 100
    end
    object cdsDetailp_custom9: TStringField
      FieldName = 'p_custom9'
      Size = 100
    end
    object cdsDetailp_custom10: TStringField
      FieldName = 'p_custom10'
      Size = 100
    end
    object cdsDetaildepotcode: TStringField
      FieldName = 'depotcode'
      Size = 40
    end
    object cdsDetaildepotname: TWideStringField
      FieldName = 'depotname'
      Size = 60
    end
    object cdsDetailunitname: TWideStringField
      FieldName = 'unitname'
      Size = 40
    end
    object cdsDetailunitrate: TFloatField
      FieldName = 'unitrate'
    end
    object cdsDetailbaseunitname: TWideStringField
      FieldName = 'baseunitname'
      Size = 40
    end
    object cdsDetailunitassrate: TFloatField
      FieldName = 'unitassrate'
    end
    object cdsDetailunitassname: TWideStringField
      FieldName = 'unitassname'
      Size = 40
    end
    object cdsDetailbarcode: TWideStringField
      FieldName = 'barcode'
      Size = 40
    end
    object cdsDetailproductpic: TBlobField
      FieldName = 'productpic'
    end
    object cdsDetailproducttypeid: TIntegerField
      FieldName = 'producttypeid'
    end
    object cdsDetailproducttrademarkid: TIntegerField
      FieldName = 'producttrademarkid'
    end
    object cdsDetailfactqty: TFloatField
      FieldName = 'factqty'
    end
    object cdsDetailbookqty: TFloatField
      FieldName = 'bookqty'
    end
    object n: TFloatField
      FieldName = 'square'
    end
    object cdsDetailcubage: TFloatField
      FieldName = 'cubage'
    end
  end
  inherited qryDetail: TUniQuery
    SQL.Strings = (
      
        'select d.*,cast(dbo.f_getallqty(d.productid,unit1qty,unit2qty,un' +
        'it3qty) as varchar(30)) as Allqty '
      
        '     ,dbo.f_getrelationbcode(d.relationbtype,d.relationbid) as r' +
        'elationbcode'
      
        '     ,round((d.price*(1+d.taxrate/100)/(d.disc/100))*(1-d.disc/1' +
        '00)*d.quantity,2) as discamt'
      
        '     ,p.code p_code, p.name p_name, p.spec p_spec, p.abname p_ab' +
        'name'
      
        '     ,p.custom1 p_custom1, p.custom2 p_custom2, p.custom3 p_cust' +
        'om3, p.custom4 p_custom4, p.custom5 p_custom5 '
      
        '     ,p.custom6 p_custom6, p.custom7 p_custom7, p.custom8 p_cust' +
        'om8, p.custom9 p_custom9, p.custom10 p_custom10 '
      '     ,dt.code depotcode, dt.name depotname '
      
        '     ,u.barcode, u.unitname, u.rate unitrate, t.unitname as base' +
        'unitname,l.unitname as unitassname '
      '    ,pic.pic as productpic'
      '     from tb_purchasedtl d'
      '     left join td_product p on d.productid=p.p_id'
      '     left join td_depot dt on d.depotid=dt.depotid'
      '     left join td_unitprice u on d.unitid=u.unitid'
      
        '     left join td_unitprice t on (d.productid=t.productid and t.' +
        'baseunit=1)   '
      
        '     left join td_unitprice l on (d.productid=l.productid and l.' +
        'u_no=0)'
      
        '     left join td_productpic pic on d.productid=pic.productid an' +
        'd pic.defpic=1'
      '     order by d.borderno')
    Left = 184
    Top = 308
    object qryDetailbid: TIntegerField
      FieldName = 'bid'
    end
    object qryDetailbno: TIntegerField
      FieldName = 'bno'
    end
    object qryDetailborderno: TIntegerField
      FieldName = 'borderno'
    end
    object qryDetaildepotid: TIntegerField
      FieldName = 'depotid'
    end
    object qryDetailproductid: TIntegerField
      FieldName = 'productid'
    end
    object qryDetailcprice: TFloatField
      FieldName = 'cprice'
    end
    object qryDetailbprice: TFloatField
      FieldName = 'bprice'
    end
    object qryDetailbquantity: TFloatField
      FieldName = 'bquantity'
    end
    object qryDetaildisc: TFloatField
      FieldName = 'disc'
    end
    object qryDetailtaxrate: TFloatField
      FieldName = 'taxrate'
    end
    object qryDetailamount: TFloatField
      FieldName = 'amount'
    end
    object qryDetailunitid: TIntegerField
      FieldName = 'unitid'
    end
    object qryDetailquantity: TFloatField
      FieldName = 'quantity'
    end
    object qryDetailprice: TFloatField
      FieldName = 'price'
    end
    object qryDetailunit1qty: TFloatField
      FieldName = 'unit1qty'
    end
    object qryDetailunit2qty: TFloatField
      FieldName = 'unit2qty'
    end
    object qryDetailunit3qty: TFloatField
      FieldName = 'unit3qty'
    end
    object qryDetailassqty: TFloatField
      FieldName = 'assqty'
    end
    object qryDetailrelationassqty: TFloatField
      FieldName = 'relationassqty'
    end
    object qryDetailtaxamt: TFloatField
      FieldName = 'taxamt'
    end
    object qryDetailproductamt: TFloatField
      FieldName = 'productamt'
    end
    object qryDetailbatchcode: TStringField
      FieldName = 'batchcode'
      Size = 200
    end
    object qryDetailproductdate: TDateTimeField
      FieldName = 'productdate'
    end
    object qryDetailvaliddate: TDateTimeField
      FieldName = 'validdate'
    end
    object qryDetailrelationpid: TIntegerField
      FieldName = 'relationpid'
    end
    object qryDetailrelationcount: TByteField
      FieldName = 'relationcount'
    end
    object qryDetailrelationbtype: TIntegerField
      FieldName = 'relationbtype'
    end
    object qryDetailrelationbid: TIntegerField
      FieldName = 'relationbid'
    end
    object qryDetailrelationbno: TIntegerField
      FieldName = 'relationbno'
    end
    object qryDetailrelationqty: TFloatField
      FieldName = 'relationqty'
    end
    object qryDetailsaleorderbcode: TStringField
      FieldName = 'saleorderbcode'
      Size = 60
    end
    object qryDetailioqty: TFloatField
      FieldName = 'ioqty'
    end
    object qryDetailinvqty: TFloatField
      FieldName = 'invqty'
    end
    object qryDetailinvamt: TFloatField
      FieldName = 'invamt'
    end
    object qryDetailcustom1: TStringField
      FieldName = 'custom1'
      Size = 200
    end
    object qryDetailcustom2: TStringField
      FieldName = 'custom2'
      Size = 200
    end
    object qryDetailcustom3: TStringField
      FieldName = 'custom3'
      Size = 200
    end
    object qryDetailcustom4: TStringField
      FieldName = 'custom4'
      Size = 200
    end
    object qryDetailcustom5: TStringField
      FieldName = 'custom5'
      Size = 200
    end
    object qryDetailcustom6: TStringField
      FieldName = 'custom6'
      Size = 200
    end
    object qryDetailcustom7: TStringField
      FieldName = 'custom7'
      Size = 200
    end
    object qryDetailcustom8: TStringField
      FieldName = 'custom8'
      Size = 200
    end
    object qryDetailcustom9: TStringField
      FieldName = 'custom9'
      Size = 200
    end
    object qryDetailcustom10: TStringField
      FieldName = 'custom10'
      Size = 200
    end
    object qryDetailexplan: TStringField
      FieldName = 'explan'
      Size = 200
    end
    object qryDetailsplitbtype: TIntegerField
      FieldName = 'splitbtype'
    end
    object qryDetailsplitbid: TIntegerField
      FieldName = 'splitbid'
    end
    object qryDetailsplitbno: TIntegerField
      FieldName = 'splitbno'
    end
    object qryDetailalreadyapt: TFloatField
      FieldName = 'alreadyapt'
    end
    object qryDetailcontractno: TStringField
      FieldName = 'contractno'
      Size = 40
    end
    object qryDetailtaxprice: TFloatField
      FieldName = 'taxprice'
    end
    object qryDetailformerprice: TFloatField
      FieldName = 'formerprice'
    end
    object qryDetailformertaxprice: TFloatField
      FieldName = 'formertaxprice'
    end
    object qryDetailpresent: TBooleanField
      FieldName = 'present'
    end
    object qryDetailcreate_time: TDateTimeField
      FieldName = 'create_time'
    end
    object qryDetailcustom11: TFloatField
      FieldName = 'custom11'
    end
    object qryDetailcustom12: TFloatField
      FieldName = 'custom12'
    end
    object qryDetailcustom13: TFloatField
      FieldName = 'custom13'
    end
    object qryDetailcustom14: TFloatField
      FieldName = 'custom14'
    end
    object qryDetailcustom15: TFloatField
      FieldName = 'custom15'
    end
    object qryDetaildcbprice: TFloatField
      FieldName = 'dcbprice'
    end
    object qryDetaildcprice: TFloatField
      FieldName = 'dcprice'
    end
    object qryDetaildcproductamt: TFloatField
      FieldName = 'dcproductamt'
    end
    object qryDetaildcamount: TFloatField
      FieldName = 'dcamount'
    end
    object qryDetaildctaxprice: TFloatField
      FieldName = 'dctaxprice'
    end
    object qryDetaildctaxamt: TFloatField
      FieldName = 'dctaxamt'
    end
    object qryDetaillength: TFloatField
      FieldName = 'length'
    end
    object qryDetailwidth: TFloatField
      FieldName = 'width'
    end
    object qryDetailheight: TFloatField
      FieldName = 'height'
    end
    object qryDetailsquare: TFloatField
      FieldName = 'square'
    end
    object qryDetailcubage: TFloatField
      FieldName = 'cubage'
    end
    object qryDetailspecificweight: TFloatField
      FieldName = 'specificweight'
    end
    object qryDetailcustom16: TFloatField
      FieldName = 'custom16'
    end
    object qryDetailcustom17: TFloatField
      FieldName = 'custom17'
    end
    object qryDetailcustom18: TFloatField
      FieldName = 'custom18'
    end
    object qryDetailcustom19: TFloatField
      FieldName = 'custom19'
    end
    object qryDetailcustom20: TFloatField
      FieldName = 'custom20'
    end
    object qryDetailweightfranchise: TFloatField
      FieldName = 'weightfranchise'
    end
    object qryDetailwfqty: TFloatField
      FieldName = 'wfqty'
    end
    object qryDetailAllqty: TStringField
      FieldName = 'Allqty'
      Size = 30
    end
    object qryDetailrelationbcode: TStringField
      FieldName = 'relationbcode'
      Size = 30
    end
    object qryDetaildiscamt: TFloatField
      FieldName = 'discamt'
    end
    object qryDetailp_code: TStringField
      FieldName = 'p_code'
      Size = 40
    end
    object qryDetailp_name: TWideStringField
      FieldName = 'p_name'
      Size = 60
    end
    object qryDetailp_spec: TWideStringField
      FieldName = 'p_spec'
      Size = 60
    end
    object qryDetailp_kind: TIntegerField
      FieldName = 'p_kind'
    end
    object qryDetailp_calc: TByteField
      FieldName = 'p_calc'
    end
    object qryDetailp_batch: TBooleanField
      FieldName = 'p_batch'
    end
    object qryDetailp_abname: TWideStringField
      FieldName = 'p_abname'
      Size = 60
    end
    object qryDetailp_custom1: TStringField
      FieldName = 'p_custom1'
      Size = 100
    end
    object qryDetailp_custom2: TStringField
      FieldName = 'p_custom2'
      Size = 100
    end
    object qryDetailp_custom3: TStringField
      FieldName = 'p_custom3'
      Size = 100
    end
    object qryDetailp_custom4: TStringField
      FieldName = 'p_custom4'
      Size = 100
    end
    object qryDetailp_custom5: TStringField
      FieldName = 'p_custom5'
      Size = 100
    end
    object qryDetailp_custom6: TStringField
      FieldName = 'p_custom6'
      Size = 100
    end
    object qryDetailp_custom7: TStringField
      FieldName = 'p_custom7'
      Size = 100
    end
    object qryDetailp_custom8: TStringField
      FieldName = 'p_custom8'
      Size = 100
    end
    object qryDetailp_custom9: TStringField
      FieldName = 'p_custom9'
      Size = 100
    end
    object qryDetailp_custom10: TStringField
      FieldName = 'p_custom10'
      Size = 100
    end
    object qryDetaildepotcode: TStringField
      FieldName = 'depotcode'
      Size = 40
    end
    object qryDetaildepotname: TWideStringField
      FieldName = 'depotname'
      Size = 60
    end
    object qryDetailunitname: TWideStringField
      FieldName = 'unitname'
      Size = 40
    end
    object qryDetailunitrate: TFloatField
      FieldName = 'unitrate'
    end
    object qryDetailbaseunitname: TWideStringField
      FieldName = 'baseunitname'
      Size = 40
    end
    object qryDetailunitassrate: TFloatField
      FieldName = 'unitassrate'
    end
    object qryDetailunitassname: TWideStringField
      FieldName = 'unitassname'
      Size = 40
    end
    object qryDetailbarcode: TWideStringField
      FieldName = 'barcode'
      Size = 40
    end
    object qryDetailproductpic: TBlobField
      FieldName = 'productpic'
    end
    object qryDetailproducttypeid: TIntegerField
      FieldName = 'producttypeid'
    end
    object qryDetailfactqty: TFloatField
      FieldName = 'factqty'
    end
    object qryDetailbookqty: TFloatField
      FieldName = 'bookqty'
    end
    object qryDetailproducttrademarkid: TIntegerField
      FieldName = 'producttrademarkid'
    end
  end
  inherited MainDataSet: TUniQuery
    SQL.Strings = (
      'select top 1 m.*, t.scamt,t.iscash,t.code t_code,t.name t_name '
      '    , bt.code bt_code,bt.name bt_name, nt.kname notetypename'
      '    , n.code moneycode, n.name moneyname'
      
        '    , ct.name + '#39' '#39' + cast(aa.voucherno as varchar(10)) as vouch' +
        'ercode '
      '     from tb_purchase m '
      '     left join tfb_voucher aa on (aa.voucherid=m.voucherid)'
      '     left join tfd_vouword ct on (ct.id=aa.vouwordid)'
      '     left join td_trader t on m.traderid=t.traderid'
      '     left join td_trader bt on m.btraderid=bt.traderid'
      '     left join ts_kind nt on nt.kind=5014 and m.notetype=kid'
      '     left join td_money n on m.moneyid=n.moneyid'
      '     where 1=1')
    Top = 193
    object MainDataSetbid: TIntegerField
      FieldName = 'bid'
    end
    object MainDataSetbkind: TIntegerField
      FieldName = 'bkind'
    end
    object MainDataSetbstate: TIntegerField
      FieldName = 'bstate'
    end
    object MainDataSetbcode: TStringField
      FieldName = 'bcode'
      Size = 40
    end
    object MainDataSetbdate: TDateTimeField
      FieldName = 'bdate'
    end
    object MainDataSettraderid: TIntegerField
      FieldName = 'traderid'
    end
    object MainDataSetnotetype: TIntegerField
      FieldName = 'notetype'
    end
    object MainDataSetnoteno: TStringField
      FieldName = 'noteno'
      Size = 40
    end
    object MainDataSetbalanceid: TIntegerField
      FieldName = 'balanceid'
    end
    object MainDataSetaccountid: TIntegerField
      FieldName = 'accountid'
    end
    object MainDataSetfilid: TIntegerField
      FieldName = 'filid'
    end
    object MainDataSetempid: TIntegerField
      FieldName = 'empid'
    end
    object MainDataSetcreate_by: TIntegerField
      FieldName = 'create_by'
    end
    object MainDataSetcheck_by: TIntegerField
      FieldName = 'check_by'
    end
    object MainDataSetdeptid: TIntegerField
      FieldName = 'deptid'
    end
    object MainDataSetvoucherid: TIntegerField
      FieldName = 'voucherid'
    end
    object MainDataSetcostvoucherid: TIntegerField
      FieldName = 'costvoucherid'
    end
    object MainDataSettransporttype: TIntegerField
      FieldName = 'transporttype'
    end
    object MainDataSetcheckno: TStringField
      FieldName = 'checkno'
      Size = 40
    end
    object MainDataSettargetaddr: TStringField
      FieldName = 'targetaddr'
      Size = 200
    end
    object MainDataSettermdays: TIntegerField
      FieldName = 'termdays'
    end
    object MainDataSetdisc: TFloatField
      FieldName = 'disc'
    end
    object MainDataSettaxrate: TFloatField
      FieldName = 'taxrate'
    end
    object MainDataSetamount: TFloatField
      FieldName = 'amount'
    end
    object MainDataSetbalanceamt: TFloatField
      FieldName = 'balanceamt'
    end
    object MainDataSetrelationamt: TFloatField
      FieldName = 'relationamt'
    end
    object MainDataSetrelationcount: TByteField
      FieldName = 'relationcount'
    end
    object MainDataSetsaleorderbcode: TStringField
      FieldName = 'saleorderbcode'
      Size = 200
    end
    object MainDataSetbtraderid: TIntegerField
      FieldName = 'btraderid'
    end
    object MainDataSetinvbdate: TDateTimeField
      FieldName = 'invbdate'
    end
    object MainDataSetinvtype: TIntegerField
      FieldName = 'invtype'
    end
    object MainDataSetinvamt: TFloatField
      FieldName = 'invamt'
    end
    object MainDataSetinvclose: TIntegerField
      FieldName = 'invclose'
    end
    object MainDataSetcustom1: TStringField
      FieldName = 'custom1'
      Size = 200
    end
    object MainDataSetcustom2: TStringField
      FieldName = 'custom2'
      Size = 200
    end
    object MainDataSetcustom3: TStringField
      FieldName = 'custom3'
      Size = 200
    end
    object MainDataSetcustom4: TStringField
      FieldName = 'custom4'
      Size = 200
    end
    object MainDataSetcustom5: TStringField
      FieldName = 'custom5'
      Size = 200
    end
    object MainDataSetcustom6: TStringField
      FieldName = 'custom6'
      Size = 200
    end
    object MainDataSetcustom7: TStringField
      FieldName = 'custom7'
      Size = 200
    end
    object MainDataSetcustom8: TStringField
      FieldName = 'custom8'
      Size = 200
    end
    object MainDataSetcustom9: TStringField
      FieldName = 'custom9'
      Size = 200
    end
    object MainDataSetcustom10: TStringField
      FieldName = 'custom10'
      Size = 200
    end
    object MainDataSetupdate_time: TDateTimeField
      FieldName = 'update_time'
    end
    object MainDataSetremark: TStringField
      FieldName = 'remark'
      Size = 200
    end
    object MainDataSetbalancedate: TDateTimeField
      FieldName = 'balancedate'
    end
    object MainDataSetcontacter: TStringField
      FieldName = 'contacter'
      Size = 60
    end
    object MainDataSetcontactphone: TStringField
      FieldName = 'contactphone'
      Size = 40
    end
    object MainDataSetcontactfax: TStringField
      FieldName = 'contactfax'
      Size = 60
    end
    object MainDataSetcreate_time: TDateTimeField
      FieldName = 'create_time'
    end
    object MainDataSetcheck_time: TDateTimeField
      FieldName = 'check_time'
    end
    object MainDataSetcustom11: TFloatField
      FieldName = 'custom11'
    end
    object MainDataSetcustom12: TFloatField
      FieldName = 'custom12'
    end
    object MainDataSetcustom13: TFloatField
      FieldName = 'custom13'
    end
    object MainDataSetcustom14: TFloatField
      FieldName = 'custom14'
    end
    object MainDataSetcustom15: TFloatField
      FieldName = 'custom15'
    end
    object MainDataSetmoneyid: TIntegerField
      FieldName = 'moneyid'
    end
    object MainDataSetexchrate: TFloatField
      FieldName = 'exchrate'
    end
    object MainDataSetdcamount: TFloatField
      FieldName = 'dcamount'
    end
    object MainDataSetdcbalanceamt: TFloatField
      FieldName = 'dcbalanceamt'
    end
    object MainDataSetdcrelationamt: TFloatField
      FieldName = 'dcrelationamt'
    end
    object MainDataSetrelationsuramt: TFloatField
      FieldName = 'relationsuramt'
    end
    object MainDataSetdcrelationsuramt: TFloatField
      FieldName = 'dcrelationsuramt'
    end
    object MainDataSetdepotid: TIntegerField
      FieldName = 'depotid'
    end
    object MainDataSetscamt: TFloatField
      FieldName = 'scamt'
    end
    object MainDataSetiscash: TBooleanField
      FieldName = 'iscash'
    end
    object MainDataSett_code: TWideStringField
      FieldName = 't_code'
      Size = 50
    end
    object MainDataSett_name: TWideStringField
      FieldName = 't_name'
      Size = 80
    end
    object MainDataSetbt_code: TWideStringField
      FieldName = 'bt_code'
      Size = 50
    end
    object MainDataSetbt_name: TWideStringField
      FieldName = 'bt_name'
      Size = 80
    end
    object MainDataSetnotetypename: TStringField
      FieldName = 'notetypename'
      Size = 50
    end
    object MainDataSetmoneycode: TStringField
      FieldName = 'moneycode'
      Size = 40
    end
    object MainDataSetmoneyname: TStringField
      FieldName = 'moneyname'
      Size = 60
    end
    object MainDataSetvouchercode: TStringField
      FieldName = 'vouchercode'
      Size = 71
    end
    object MainDataSetprojectid: TIntegerField
      FieldName = 'projectid'
    end
    object MainDataSetpjcode: TWideStringField
      FieldName = 'pjcode'
      Size = 40
    end
    object MainDataSetpjname: TWideStringField
      FieldName = 'pjname'
      Size = 60
    end
  end
end
